package com.piece.core.framework.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 基础异常
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class FrameWorkException extends RuntimeException {

    /**
     * 错误码
     */
    private Integer code;

    /**
     * 错误提示
     */
    private String message;

    public FrameWorkException(ErrorCode errorType) {
        this.code = errorType.getCode();
        this.message = errorType.getMsg();
    }

    @Override
    public String getMessage() {
        return message;
    }
}